package Raid;

import org.newdawn.slick.geom.*;

public class Utils {

	
	public static boolean intersects(Rectangle a, Rectangle b){
		float x1 = a.getMinX();
		float x2 = b.getMinX();
		float y1 = a.getMinY();
		float y2 = b.getMinY();
		float w1 = a.getWidth();
		float w2 = b.getWidth();
		float h1 = a.getHeight();
		float h2 = b.getHeight();
		if (x1 > (x2 - w1) && x1 < (x2 + w2)){ // Correct xish values
			if (y1 > (y2 - h1) && y1 < (y2 + h2)){
				return true;
			} else{
				return false;
			}
		} else{
			return false;
		}
	}
}
